
<div class="m-l nav navbar-nav m-t block">
	<span>
		<a class="btn btn-xs btn-gray" [routerLink]="['../../']"><i class="fa fa-undo">返回</i></a>
	</span>
	<span> 系统管理 ></span>
	<span> 产品设置 ></span>
	<span> 柜门配置</span>       
</div>
<div class="m-t-lg">
  <div class="wrapper-sm">
	<div class="panel panel-default">
		<div class="panel-body">
			<div style="border-color: #e5e5e5;padding: 10px;background-color: #e5e5e5">
				<div class="row">					
					<div class="col-md-6">
						<span style="font-size: 18px;font-weight: bold;">{{proData?.product_name}}</span>
						<span>柜门模板</span>
					</div> 
					<div class="col-md-6" style="text-align: right">
						<button class="btn btn-info" (click)="myModal.show();btype=1" *ngIf="ydoordata?.length==0">
							新增
						</button>
					</div>			
				</div>
			</div>
			<table class="table table-hover table-striped m-b-none default footable" *ngIf="ydoordata?.length==0">
				<tr>
					<th>柜门编号</th>
					<th>柜门名称</th>
					<th>尺寸类型</th>
					<th>充电类型</th>
					
				</tr>
				<tr *ngFor="let num of doordata;let i = index">
					<td>{{i+1}}</td>
					<td>
						<input type="text"  name="doorname" placeholder="请输入柜门名称" class="form-control" id="door_name{{i}}" [(ngModel)]="num.dna[i]">
					</td>
					<td>
						<select class="form-control" id="door_size{{i}}" [(ngModel)]="num.dsz[i]">
							<option value="2">大</option>
							<option value="1">中</option>
							<option value="0">小</option>
						</select>
					</td>
					<td>
						<select class="form-control" id="door_charge{{i}}" [(ngModel)]="num.dcg[i]">
							<option value="1">是</option>
							<option value="0">否</option>
						</select>
					</td>
					

				</tr>
				<tr>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td>
						<button class="btn btn-sm btn-info" (click)="savealldoor(doordata)">确定保存</button>
					</td>
				</tr>
				
			</table>
			<table class="table table-hover table-striped m-b-none default footable" *ngIf="ydoordata?.length!=0">
				<tr>
					<th>柜门编号</th>
					<th>柜门名称</th>
					<th>尺寸类型</th>
					<th>充电类型</th>					
				</tr>
				<tr *ngFor="let ydoordata of ydoordata">
					<td>{{ydoordata.door_number}}</td>
					<td>{{ydoordata.door_name}}</td>
					<td>
					
						<span *ngIf="ydoordata.door_size==0">小</span>
						<span *ngIf="ydoordata.door_size==1">中</span>
						<span *ngIf="ydoordata.door_size==2">大</span>
					</td>
					<td>
						<span *ngIf="ydoordata.door_charge==0">否</span>
						<span *ngIf="ydoordata.door_charge==1">是</span>
					</td>
				</tr>
			</table>
			
			
		</div>
	</div>
  </div>
</div>
<!-- </div> -->
<div>
  <div bsModal #myModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg" style="width: 800px">
      <div class="modal-content">
		  <div class="modal-header">
		    <h4 class="modal-title" *ngIf="btype==1">新增柜门</h4>		   
		    <h4 class="modal-title" *ngIf="btype==3">删除柜门</h4>
		   <!--  <button class="close" aria-label="Close" (click)="closeModal()">
		      <span aria-hidden="true">&times;</span>
		    </button> -->
		  </div>
		  <div class="modal-body">
		    <form class="form-horizontal" *ngIf="btype==1">
		        
		        <div class="form-group row" >
		        	
		          <label class="col-sm-3  control-label" style="text-align: right">柜门数量</label>
		          <div class="col-sm-7">
		            <input type="text"  class="form-control" placeholder="请输入柜门序号" name="door_number"  [(ngModel)]='door_number'  required="">
		          </div>
		          <div class="col-sm-2" style="color:red;margin-top: 10px;" >
		            <p [hidden]="door_number" >必填</p>
		          </div>
		        </div>
		         
		        
		    </form>
		    <div *ngIf="btype==3">
		    	<div style="background-color: #e5e5e5;padding: 10px;border-radius: 5px;">
		    		<h4>确定要删除<strong>柜门:{{deldoorname}}</strong>嘛？</h4>
		    	</div>
		    </div>
		  </div>
		  <div class="modal-footer">
		    <button class="btn btn-info confirm-btn" (click)="comfirmnumber()" [disabled]="!door_number" *ngIf="btype==1">保存</button>		    
		    <button class="btn  btn-danger" (click)="deldoorsave()" *ngIf="btype==3">确定</button>		  
		    <button class="btn  confirm-btn " (click)="myModal.hide();cancel();">取消</button>
		  </div>
		</div>
     
    </div>
  </div>
</div>

